home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / shell / AXshDemo131.lha / InstallDisk.lha / Install-AXsh_2.0 < prev    next >
Encoding:
Text File  |  1994-03-26  |  8.8 KB  |  340 lines

  1. ; script to install AXsh 1.31
  2.  
  3. (set newversion 1)
  4. (set newrevision 31)
  5.  
  6. (transcript "Checking user level.")
  7. (if    (< @user-level 1)
  8.     (
  9.         (transcript "Installation aborted due to too low user level.")
  10.         (abort    "AXsh installation requires at least the \"average\" user "
  11.             "level. Restart installation and select appropriate user level."
  12.         )
  13.     )
  14. )
  15.  
  16. (onerror
  17.     (makeassign "AXsh")
  18. )
  19.  
  20. (set #bad-kick
  21.     (cat     "You must be using Kickstart 2.04 to install using this script. "
  22.         "Double-click the 'AXsh-Install_1.3' icon to install AXsh on "
  23.         "Kickstart 1.2 or 1.3 machines."))
  24.  
  25. (complete 0)
  26.  
  27.     ; check kick
  28. (set vernum (getversion "graphics.library" (resident)))
  29. (set ver (/ vernum 65536))
  30. (set rev (- vernum (* ver 65536) ) )
  31.  
  32. (if (< ver 37)
  33.     ((abort #bad-kick)))
  34.  
  35.     ; see if this is really an update
  36. (set is_update 0)
  37. (set AXsh_dest (getassign "AXsh" "av"))
  38.  
  39.     ; if update, be sure they want program in same place
  40. (if AXsh_dest
  41.     (if    (askbool
  42.             (prompt "Your current copy of AXsh appears to be located in the drawer named \""
  43.                 AXsh_dest "\". Do you want to update the installed version ?"
  44.             )
  45.             (help    "The installer has determined that you may already have a copy "
  46.                 "of AXsh installed on your system. If this is wrong or you want "
  47.                 "the update installed elsewhere, select NO as an answer. "
  48.                 "Otherwise, select YES.\n"
  49.                 "If you select YES, only binaries, manuals, information files and "
  50.                 "possibly language files are copied. Configuration files, home "
  51.                 "directories nor news/mail system files are NOT overwritten.\n"
  52.             )
  53.             (default 1)
  54.         )
  55.         (set is_update 1)        ; if user wants in same place
  56.         (set AXsh_dest            ; if user wants in different place or total rewrite
  57.             (askdir    (prompt "In which disk or drawer should AXsh be installed?")
  58.                 (help     "All AXsh subdirectoried will be created under this "
  59.                     "directory. If you are not dedicating a whole disk "
  60.                     "partition for AXsh, you should create a subdirectory "
  61.                     "for AXsh yourself.\n\n"
  62.                     @askdir-help)
  63.                 (default AXsh_dest)
  64.                 (disk)
  65.             )
  66.         )
  67.     )
  68.     ; else if not an update, get a location for program
  69.     (set AXsh_dest
  70.         (askdir    (prompt "In which disk or drawer should AXsh be installed?")
  71.             (help     "All AXsh subdirectoried will be created under this "
  72.                 "directory. If you are not dedicating a whole disk "
  73.                 "partition for AXsh, you should create a subdirectory "
  74.                 "for AXsh yourself.\n\n"
  75.                 @askdir-help)
  76.             (default @default-dest)
  77.             (disk)
  78.         )
  79.     )
  80. )
  81.  
  82.  
  83. (set oldver (getversion (tackon AXsh_dest "bin/AXsh")))
  84. (set oldv (/ oldver 65536))
  85. (set oldr (- oldver (* oldv 65536) ) )
  86.  
  87. (if    (or    (and (= oldv newversion) (>= oldr newrevision))    (> oldv newversion))
  88.     (message "You already have AXsh version greater or equal than "
  89.          newversion "." newrevision " installed in \"" AXsh_dest
  90.          "\" (AXsh " oldv "." oldr ")\n" )
  91. )
  92.  
  93.  
  94.     ; at this point we have a valid destination, so we tell installer where
  95.     ; the application will end up so the exit page will be correct -- also,
  96.     ; the installation log file (if any) will be copied to the destination
  97. (set @default-dest AXsh_dest)
  98.  
  99. (if    (getassign "AXsh" "vd")
  100.     (
  101.         (transcript "AXsh: is a partition!\n")
  102.         (if    (not (= AXsh_dest "AXsh:"))
  103.             (if    (askbool
  104.                     (prompt "Your current copy of AXsh is in a Volume.\n"
  105.                         "\"Assign AXsh: " AXsh_dest "\" will fail.\n"
  106.                         "Do you still want to continue ?"
  107.                     )
  108.                     (help    "The installer has determined that your old version of AXsh "
  109.                         "is installed in a partition named AXsh. Cancelling this by "
  110.                         "an assign is not possible and thus this installation will not "
  111.                         "be totally successfull until you relabel the partition.\n"
  112.                         "You can also install AXsh on top of the old AXsh system, "
  113.                         "because old configuration files are preserved.\n"
  114.                     )
  115.                     (default 1)
  116.                 )
  117.                 (transcript "Continuing installation...\n")
  118.                 (exit (quiet))
  119.             )
  120.         )
  121.     )
  122. )
  123.  
  124. (askdisk
  125.     (prompt "Please insert \n the master program disk \n labeled \"AXshPack\".")
  126.     (help    "The AXsh program and other options will be copied "
  127.         "from \"AXshPack:\" into your system.")
  128.     (dest  "AXshPack")
  129.     (newname "AXsh")
  130.     (assigns)    ; Allow assigns so you don't need to use a floppy
  131. )
  132.  
  133. (if (exists "locale:" (noreq))
  134.     ; KS2.1 or newer
  135.     (set whichfiles
  136.         (askoptions
  137.             (prompt "Please select the files to be copied")
  138.             (help    "This allows you to select only certain parts of the AXsh "
  139.                 "system to be installed on your hard drive. For normal installation "
  140.                 "select all the items")
  141.             (choices "AXsh system"
  142.                  "Manual pages"
  143.                  "WB launchable system services"
  144.                  "Languages")
  145.         )
  146.     )
  147.     ; KS2.0
  148.     (set whichfiles
  149.         (askoptions
  150.             (prompt "Please select the files to be copied")
  151.             (help    "This allows you to select only certain parts of the AXsh "
  152.                 "system to be installed on your hard drive. For normal installation "
  153.                 "select all the items")
  154.             (choices "AXsh system"
  155.                  "Manual pages"
  156.                  "WB launchable system services")
  157.         )
  158.     )
  159. )
  160.  
  161. (if    (in whichfiles 0)
  162.     (
  163.         (makedir (tackon AXsh_dest "bin")    (infos))
  164.         (makedir (tackon AXsh_dest "info")    (infos))
  165.         (makedir (tackon AXsh_dest "storage")    (infos))
  166.  
  167.         (copyfiles
  168.             (source "AXshPack:bin")
  169.             (dest (tackon AXsh_dest "bin"))
  170.             (infos)    (all)
  171.         )
  172.  
  173.         ; If we are updating, do not overwrite config files
  174.         (if    (or    (not is_update)
  175.                 (not (exists (tackon AXsh_dest "etc") (noreq))))
  176.             (
  177.                 (makedir (tackon AXsh_dest "etc")    (infos))
  178.                 (copyfiles
  179.                     (source "AXshPack:etc")
  180.                     (dest (tackon AXsh_dest "etc"))
  181.                     (infos)    (all)
  182.                 )
  183.             )
  184.         )
  185.         (if    (or    (not is_update)
  186.                 (not (exists (tackon AXsh_dest "home") (noreq))))
  187.             (
  188.                 (makedir (tackon AXsh_dest "home")    (infos))
  189.                 (copyfiles
  190.                     (source "AXshPack:home")
  191.                     (dest (tackon AXsh_dest "home"))
  192.                     (infos)    (all)
  193.                 )
  194.             )
  195.         )
  196.         (if    (or    (not is_update)
  197.                 (not (exists (tackon AXsh_dest "usr") (noreq))))
  198.             (
  199.                 (makedir (tackon AXsh_dest "usr")    (infos))
  200.                 (copyfiles
  201.                     (source "AXshPack:usr")
  202.                     (dest (tackon AXsh_dest "usr"))
  203.                     (infos)    (all)
  204.                 )
  205.             )
  206.         )
  207.         (complete 50)
  208.  
  209.         (copyfiles
  210.             (source "AXshPack:info")
  211.             (dest (tackon AXsh_dest "info"))
  212.             (infos)    (all)
  213.         )
  214.         (copyfiles
  215.             (source "AXshPack:storage")
  216.             (dest (tackon AXsh_dest "storage"))
  217.             (infos)    (all)
  218.         )
  219.         (copyfiles
  220.             (source "AXshPack:AXsh.info")
  221.             (dest AXsh_dest)
  222.         )
  223.     )
  224. )
  225.  
  226. (complete 80)
  227.  
  228. (if    (in whichfiles 1)
  229.     (
  230.         (copyfiles
  231.             (source "AXshPack:man")
  232.             (dest (tackon AXsh_dest "man"))
  233.             (infos)    (all)
  234.         )
  235.         (copyfiles
  236.             (source (cat "AXshPack:AXshUpdates" newversion "." newrevision))
  237.             (dest AXsh_dest)
  238.             (infos)
  239.         )
  240.     )
  241. )
  242.  
  243. (if    (in whichfiles 2)
  244.     (
  245.         (copyfiles
  246.             (source "AXshPack:storage/AX-Sysghost.info")
  247.             (dest "SYS:WBStartup")
  248.         )
  249.         (copyfiles
  250.             (source "AXshPack:storage/AX-Server.info")
  251.             (dest "SYS:WBStartup")
  252.         )
  253.         ; If user-startup mounts handlers automatically (>=2.1)
  254.         ; just use that method. We need to copy the handlers to L:
  255.         ; because AXsh: is not mounted when they are mounted.
  256.         ; Also, mount files (icons) refer to handlers in L:
  257.         (if    (exists "Devs:DOSDrivers" (noreq))
  258.             (
  259.                 (copyfiles
  260.                     (source "AXshPack:Storage/DosDrivers/NEWAUX")
  261.                     (dest "DEVS:DosDrivers")
  262.                     (infos)
  263.                 )
  264.                 (copyfiles
  265.                     (source "AXshPack:bin/NEWAUX-Handler")
  266.                     (dest "L:")
  267.                 )
  268.                 (copyfiles
  269.                     (source "AXshPack:bin/AXAUX-Handler")
  270.                     (dest "L:")
  271.                 )
  272.             )
  273.         )
  274.         ; In pre 2.1 system, add the mount command(s) to user-startup
  275.     )
  276. )
  277.  
  278. (if    (in whichfiles 3)
  279.     (
  280.         (working "Unpacking language files..")
  281.         (if    (run "lha -m x AXshPack:Storage/Locale/Catalogs Locale:")
  282.             (message "Unpacking unsuccessfull!")
  283.         )
  284.         (copyfiles
  285.             (source "AXshPack:Storage/Presets/AXsh.locale")
  286.             (dest "SYS:Prefs/Presets")
  287.             (infos)
  288.         )
  289.     )
  290. )
  291.  
  292.  
  293. (complete 95)
  294.  
  295.     ; modify S:User-Startup
  296.  
  297. (if    (= "AXsh:" AXsh_dest)
  298.     (transcript "AXsh assign/volume already exists, user-startup not touched\n")
  299.     (if    (exists "Devs:DOSDrivers" (noreq))
  300.         (startup "AXsh"
  301.             (prompt    "I need to add \"assign AXsh: " AXsh_dest "\" to the \"S:user-startup\" "
  302.                 "so that your system will be properly configured to use AXsh.")
  303.             (help "Do this or AXsh won't work!!")
  304.             (command "ASSIGN AXsh: \"" AXsh_dest "\"\n")
  305.         )
  306.         (startup "AXsh"
  307.             (prompt    "I need to add \"assign AXsh: " AXsh_dest "\" and \n"
  308.                 " \"mount NEWAUX: from AXsh:etc/Mountlist.AXsh\"\n"
  309.                 " to the \"S:user-startup\" "
  310.                 "so that your system will be properly configured to use AXsh.")
  311.             (help "Do this or AXsh won't work!!")
  312.             (command "ASSIGN AXsh: \"" AXsh_dest "\"\n"
  313.                  "mount NEWAUX: from AXsh:etc/Mountlist.AXsh\n")
  314.         )
  315.     )
  316. )
  317.  
  318. (complete 100)
  319. (if    is_update
  320.     (message "Because AXsh was installed on top of an old version, "
  321.          "configuration files were not updated. Read the file "
  322.          "AXshUpdates" newversion "." newrevision " to find out "
  323.          "about changes in the configuration files and change them "
  324.          "if needed.\n"
  325.     )
  326. )
  327.  
  328.  
  329.     ; reinitialize assigns
  330.  
  331. (if (not @pretend)
  332.     (makeassign "AXsh" AXsh_dest)
  333. )
  334.  
  335.     ; cleanup
  336. (makeassign "AXshPack" (safe))
  337.  
  338.     ; this is not strictly necessary, but doesn't hurt
  339. (exit)
  340.